package com.omt.tarjimdinek.domain.tv.service;

import java.util.List;

import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Singleton;

import org.apache.log4j.Logger;

import com.omt.tarjimdinek.domain.tv.dao.ChaineDao;
import com.omt.tarjimdinek.domain.tv.entity.Chaine;
import com.omt.tarjimdinek.support.GenericDao;
import com.omt.tarjimdinek.support.RepositoryImpl;

/**
 * Chaine manager implements
 * @author chabane
 *
 */
@Named("chaineRepository")
@Singleton
public class ChaineRepositoryImpl extends RepositoryImpl<Chaine, String> implements ChaineRepository {

	private ChaineDao chaineDao; 
	
	@SuppressWarnings("unused")
	private static final Logger log = Logger.getLogger(ChaineRepositoryImpl.class);

	@Inject
	public void setChaineDao(ChaineDao chaineDao) {
	   this.chaineDao = chaineDao;
	}

	/**
	  * Dao getter used by the {@link RepositoryImpl}.
	  */
	@Override
	public GenericDao<Chaine, String> getDao() {
	   return chaineDao;
	}     
	    
    /**
     * {@inheritDoc}
     */
	public List<Chaine> findAll() {
		return chaineDao.findAll();
	}

	/**
     * {@inheritDoc}
     */
    @Override
    public Chaine getNew() {
        return new Chaine();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public Chaine getNewWithDefaults() {
    	Chaine result = getNew();
        result.initDefaultValues();
        return result;
    }

}
